package models.forms;

import java.util.ArrayList;
import java.util.List;

import play.data.validation.*;

public class IndexForm {
	
	//@Constraints.Required( message = "This field is required.")
	//@Constraints.MaxLength(value = 20, message = "Nickname must contain less than 20 characters.")
	//@Constraints.Min(value = 3, message = "Nickanme must contsin more than 2 characters.")
	//@Constraints.Pattern(value = "^[a-zA-Z0-9]*", message = "Only letters and numbers are allowed.")
	public String userName;
	
	public List<ValidationError> validate(){
		
		List<ValidationError> error = new ArrayList();
		
		if( userName == null ){
			error.add(new ValidationError("userName", "Username is required"));
		}
		
		return error.isEmpty() ? null : error;
	}
}
